<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<?php echo @$css.@$js;?>		
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>	
<body>
<div id="add_new_client" class="win_div" style="display:block;">
<div class="win_title">添加新客户 <a href="javscript:;" onclick="parent.closeWin();" class="frame_close">[关闭] </a></div>
<div class="win_con">
<form method="post" action="<?php echo ZSM_WWW_HOST ?>/admin/api/addnewclient/do/add" onsubmit="return checkForm();">
<table>
<tr>
<td class="td_40">客户姓名</td>
<td><input type="text" id="client_name">*</td>
</tr>
<tr>
<td class="td_40">客户电话</td>
<td><input type="text" id="client_tel">*</td>
</tr>
<tr>
<td class="td_40">客户地址</td>
<td valign="top"><textarea style="width:180px;height:50px;" id="client_address"></textarea>*</td>
</tr>
<tr>
<td class="td_40"><input type="submit" value="确认" /></td>
<td>&nbsp;</td>
</tr>
</table>
</form>
</div>
</div>
<script type="text/javascript">
function checkForm()
{
	var client_name = $.trim($("#client_name").val());
	var client_tel = $.trim($("#client_tel").val());
	var client_address = $.trim($("#client_address").val());
	var url = "<?php echo ZSM_WWW_HOST.'admin/api/addnewclient/do/add';?>";
	if(client_name=='' || client_tel =='' || client_address==''){
		parent.showAlert('带*号 为必填写向');
		return false;
	}
	$.getJSON(url,{'client_name':client_name,'client_tel':client_tel,'client_address':client_address},function(rs){
		parent.showAlert(rs.html);
		if(rs.status==1)
		{
			parent.reloadClient();
			parent.closeWin();
		}
		
	});
	return false;
}
</script>
</body>
</html>